package com.dp.proxy.static_proxy;

/**
 * @Author: Ruomeng
 * @Date: 2024/11/28
 * @Description : design-pattern
 * 代理类
 * @Version: 1.0
 */
public class UserDaoProxy implements IUserDao {

    private IUserDao target;

    public UserDaoProxy(IUserDao target) {
        this.target = target;
    }

    @Override
    public void save() {
        // 扩展额外功能
        System.out.println("开启事务");
        target.save();
        System.out.println("提交事务");
    }

}
